package com.javasea.web.retry.retryDemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *@ClassName TestController
 *@Description TODO
 *@Author longxiaonan@163.com
 *@Date 2022/4/23 0023 21:33
 */
@RequestMapping
@RestController
public class TestController {

    @Autowired
    private TestRetryService testRetryService;

    /**
     * http://localhost:8080/demo/0
     * 输出：
     *     test被调用,时间：21:50:13.321
           test被调用,时间：21:50:15.321
           test被调用,时间：21:50:18.321
           回调方法执行！！！！
     * @param code
     * @throws Exception
     */
    @GetMapping("/demo/{code}")
    public void testRetry(@PathVariable Integer code) throws Exception {
        testRetryService.test(code);
    }

}
